{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np \n",
    "import pandas as pd \n",
    "\n",
    "from sklearn.metrics import r2_score \n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "数据探索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instant</th>\n",
       "      <th>dteday</th>\n",
       "      <th>season</th>\n",
       "      <th>yr</th>\n",
       "      <th>mnth</th>\n",
       "      <th>holiday</th>\n",
       "      <th>weekday</th>\n",
       "      <th>workingday</th>\n",
       "      <th>weathersit</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>casual</th>\n",
       "      <th>registered</th>\n",
       "      <th>cnt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2011-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.344167</td>\n",
       "      <td>0.363625</td>\n",
       "      <td>0.805833</td>\n",
       "      <td>0.160446</td>\n",
       "      <td>331</td>\n",
       "      <td>654</td>\n",
       "      <td>985</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>2011-01-02</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.363478</td>\n",
       "      <td>0.353739</td>\n",
       "      <td>0.696087</td>\n",
       "      <td>0.248539</td>\n",
       "      <td>131</td>\n",
       "      <td>670</td>\n",
       "      <td>801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>2011-01-03</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.196364</td>\n",
       "      <td>0.189405</td>\n",
       "      <td>0.437273</td>\n",
       "      <td>0.248309</td>\n",
       "      <td>120</td>\n",
       "      <td>1229</td>\n",
       "      <td>1349</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>2011-01-04</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>0.212122</td>\n",
       "      <td>0.590435</td>\n",
       "      <td>0.160296</td>\n",
       "      <td>108</td>\n",
       "      <td>1454</td>\n",
       "      <td>1562</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>2011-01-05</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.226957</td>\n",
       "      <td>0.229270</td>\n",
       "      <td>0.436957</td>\n",
       "      <td>0.186900</td>\n",
       "      <td>82</td>\n",
       "      <td>1518</td>\n",
       "      <td>1600</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   instant      dteday  season  yr  mnth  holiday  weekday  workingday  \\\n",
       "0        1  2011-01-01       1   0     1        0        6           0   \n",
       "1        2  2011-01-02       1   0     1        0        0           0   \n",
       "2        3  2011-01-03       1   0     1        0        1           1   \n",
       "3        4  2011-01-04       1   0     1        0        2           1   \n",
       "4        5  2011-01-05       1   0     1        0        3           1   \n",
       "\n",
       "   weathersit      temp     atemp       hum  windspeed  casual  registered  \\\n",
       "0           2  0.344167  0.363625  0.805833   0.160446     331         654   \n",
       "1           2  0.363478  0.353739  0.696087   0.248539     131         670   \n",
       "2           1  0.196364  0.189405  0.437273   0.248309     120        1229   \n",
       "3           1  0.200000  0.212122  0.590435   0.160296     108        1454   \n",
       "4           1  0.226957  0.229270  0.436957   0.186900      82        1518   \n",
       "\n",
       "    cnt  \n",
       "0   985  \n",
       "1   801  \n",
       "2  1349  \n",
       "3  1562  \n",
       "4  1600  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#读取数据，观察前五行\n",
    "data=pd.read_csv(\"day.csv\")\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 731 entries, 0 to 730\n",
      "Data columns (total 16 columns):\n",
      "instant       731 non-null int64\n",
      "dteday        731 non-null object\n",
      "season        731 non-null int64\n",
      "yr            731 non-null int64\n",
      "mnth          731 non-null int64\n",
      "holiday       731 non-null int64\n",
      "weekday       731 non-null int64\n",
      "workingday    731 non-null int64\n",
      "weathersit    731 non-null int64\n",
      "temp          731 non-null float64\n",
      "atemp         731 non-null float64\n",
      "hum           731 non-null float64\n",
      "windspeed     731 non-null float64\n",
      "casual        731 non-null int64\n",
      "registered    731 non-null int64\n",
      "cnt           731 non-null int64\n",
      "dtypes: float64(4), int64(11), object(1)\n",
      "memory usage: 91.5+ KB\n"
     ]
    }
   ],
   "source": [
    "#数据基本信息\n",
    "data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(731, 16)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "数据准备"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(366, 12)"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#数据分割，将2011年数据作为训练数据，2012年数据作为测试数据\n",
    "x_train=data.loc[0:365,['dteday','season','yr','mnth','holiday','weekday','workingday','weathersit','temp','atemp','hum','windspeed']]\n",
    "x_test=data.loc[365:,['dteday','season','yr','mnth','holiday','weekday','workingday','weathersit','temp','atemp','hum','windspeed']]\n",
    "y_train=data.loc[0:365,'cnt']\n",
    "y_test=data.loc[365:,'cnt']\n",
    "\n",
    "#columns=data.drop([\"instant\",\"dteday\",\"season\",\"yr\",\"mnth\",\"holiday\",\"weekday\",\"workingday\"],axis=1).columns\n",
    "columns=x_test.columns\n",
    "x_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>dteday</th>\n",
       "      <th>season</th>\n",
       "      <th>yr</th>\n",
       "      <th>mnth</th>\n",
       "      <th>holiday</th>\n",
       "      <th>weekday</th>\n",
       "      <th>workingday</th>\n",
       "      <th>weathersit</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2011-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.344167</td>\n",
       "      <td>0.363625</td>\n",
       "      <td>0.805833</td>\n",
       "      <td>0.160446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2011-01-02</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.363478</td>\n",
       "      <td>0.353739</td>\n",
       "      <td>0.696087</td>\n",
       "      <td>0.248539</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2011-01-03</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.196364</td>\n",
       "      <td>0.189405</td>\n",
       "      <td>0.437273</td>\n",
       "      <td>0.248309</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2011-01-04</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>0.212122</td>\n",
       "      <td>0.590435</td>\n",
       "      <td>0.160296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2011-01-05</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.226957</td>\n",
       "      <td>0.229270</td>\n",
       "      <td>0.436957</td>\n",
       "      <td>0.186900</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       dteday  season  yr  mnth  holiday  weekday  workingday  weathersit  \\\n",
       "0  2011-01-01       1   0     1        0        6           0           2   \n",
       "1  2011-01-02       1   0     1        0        0           0           2   \n",
       "2  2011-01-03       1   0     1        0        1           1           1   \n",
       "3  2011-01-04       1   0     1        0        2           1           1   \n",
       "4  2011-01-05       1   0     1        0        3           1           1   \n",
       "\n",
       "       temp     atemp       hum  windspeed  \n",
       "0  0.344167  0.363625  0.805833   0.160446  \n",
       "1  0.363478  0.353739  0.696087   0.248539  \n",
       "2  0.196364  0.189405  0.437273   0.248309  \n",
       "3  0.200000  0.212122  0.590435   0.160296  \n",
       "4  0.226957  0.229270  0.436957   0.186900  "
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>dteday</th>\n",
       "      <th>season</th>\n",
       "      <th>yr</th>\n",
       "      <th>mnth</th>\n",
       "      <th>holiday</th>\n",
       "      <th>weekday</th>\n",
       "      <th>workingday</th>\n",
       "      <th>weathersit</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>365</th>\n",
       "      <td>2012-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.370000</td>\n",
       "      <td>0.375621</td>\n",
       "      <td>0.692500</td>\n",
       "      <td>0.192167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>366</th>\n",
       "      <td>2012-01-02</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.273043</td>\n",
       "      <td>0.252304</td>\n",
       "      <td>0.381304</td>\n",
       "      <td>0.329665</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>367</th>\n",
       "      <td>2012-01-03</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.150000</td>\n",
       "      <td>0.126275</td>\n",
       "      <td>0.441250</td>\n",
       "      <td>0.365671</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>368</th>\n",
       "      <td>2012-01-04</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0.107500</td>\n",
       "      <td>0.119337</td>\n",
       "      <td>0.414583</td>\n",
       "      <td>0.184700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>369</th>\n",
       "      <td>2012-01-05</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.265833</td>\n",
       "      <td>0.278412</td>\n",
       "      <td>0.524167</td>\n",
       "      <td>0.129987</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         dteday  season  yr  mnth  holiday  weekday  workingday  weathersit  \\\n",
       "365  2012-01-01       1   1     1        0        0           0           1   \n",
       "366  2012-01-02       1   1     1        1        1           0           1   \n",
       "367  2012-01-03       1   1     1        0        2           1           1   \n",
       "368  2012-01-04       1   1     1        0        3           1           2   \n",
       "369  2012-01-05       1   1     1        0        4           1           1   \n",
       "\n",
       "         temp     atemp       hum  windspeed  \n",
       "365  0.370000  0.375621  0.692500   0.192167  \n",
       "366  0.273043  0.252304  0.381304   0.329665  \n",
       "367  0.150000  0.126275  0.441250   0.365671  \n",
       "368  0.107500  0.119337  0.414583   0.184700  \n",
       "369  0.265833  0.278412  0.524167   0.129987  "
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_test.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [],
   "source": [
    "#因为月份，季节等为类别特征，所以先将这些特证剔除，然后在进行归一化处理\n",
    "from sklearn import preprocessing\n",
    "x_train_1=x_train.drop(['dteday','season','yr','mnth','holiday','weekday','workingday'], axis = 1)\n",
    "x_test_1=x_test.drop(['dteday','season','yr','mnth','holiday','weekday','workingday'], axis = 1)\n",
    "min_max_scaler=preprocessing.MinMaxScaler()\n",
    "x_train_1=min_max_scaler.fit_transform(x_train_1)\n",
    "x_test_1=min_max_scaler.transform(x_test_1)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "正则化的线性回归（L2正则 --> 岭回归）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The r2 score of RidgeCV on test is -0.781801124534671\n",
      "The r2 score of RidgeCV on train is 0.6843180617079256\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import RidgeCV\n",
    "#设置超参数（正则参数）范围\n",
    "alphas=[0.01,0.1,1,10,100,1000,10000]\n",
    "#生成一个RidgeCV实例\n",
    "ridge=RidgeCV(alphas=alphas,store_cv_values=True)\n",
    "\n",
    "#模型训练\n",
    "ridge.fit(x_train_1,y_train)\n",
    "\n",
    "#预测\n",
    "y_test_pred_ridge=ridge.predict(x_test_1)\n",
    "y_train_pred_ridge=ridge.predict(x_train_1)\n",
    "\n",
    "#评估，使用r2_score评价模型在训练集和测试集上的性能\n",
    "\n",
    "print('The r2 score of RidgeCV on test is',r2_score(y_test,y_test_pred_ridge))\n",
    "print('The r2 score of RidgeCV on train is',r2_score(y_train,y_train_pred_ridge))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "训练集的r2 score约为0.68，说明训练集有百分之六十八符合\n",
    "测试集的r2 score约为-0.78，根据r2 score计算公式可知预测值减去真值大于真值本身之间的差异，r2 score为负值也可能说明特征可能取的有问题"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaEAAAEKCAYAAAC7c+rvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xl8XVW5//HPk3Se0iHpQNOSDmlLKSAl0NKKVAqlRaWAA4hKRYSfOCGKgqL2IlwvIAgooiJwKVdlEBmqUkoZK1CGtAht6ZTOoVPSdJ6TPL8/9kp7CJnbk32SfN+v13nlnLXX3usJDflm77POXubuiIiIxCEt7gJERKTlUgiJiEhsFEIiIhIbhZCIiMRGISQiIrFRCImISGwUQiIiEhuFkIiIxEYhJCIisWkVdwGpLjMz03NycuIuQ0SkSZk7d26xu2fV1k8hVIucnBzy8/PjLkNEpEkxs9V16afLcSIiEhuFkIiIxEYhJCIisVEIiYhIbBRCIiISG4WQiIjERiEkIiKx0eeERETkoLJyZ+G6bby+fDPH981gzODMpI6nEBIRacHcneVFu3h9eTGvFRTzxooStu05AMCV4wYphERE5Mhat3UPrxUU8/ryzby+vJiN2/cB0Ldre84+thdjB2dy6sAe9OzSLum1KIRERJq5kl37mRMC5/Xlm1lZvAuA7h3bcOqgHowdlMnYwT3o370DZtaotSmERESamV37SnlrVQmvFxTzWsFm3l+/HYCObdIZNbAHXxrVn7GDMxnaqzNpaY0bOpUphEREmrj9peW8s2YLry3fzOsFxfxn7VZKy5026WmMPLorPzhrCGMG9+D47K60Tk+tSdEKIRGRJqas3Hl/3XZeC5MJ8ldtYc+BMszguL4ZfP20gYwd3IO8o7vTvk163OXWSCEkIpLiKmawzVkeXV6bs2LzwRlsg3t24gt52YwZnMnoAT3I6NA65mrrRyEkIpKC1m/bw2sF0eW115dvZsP2vUA0g23C8DCDbVAPejXCDLZkUgiJiKSALbv2M2fF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N2JvQv12oQSSpdDlOJPlmAxeaWXp4n+YTwFvAq8Bnw3tDvYBxCfssAgaH512I1rrZFvpNqmacNKDiPaWLw/FrkgGsD2diXyG6sWuFIcCCOnxvIodFZ0Iiyfck0fs97xKdnfzI3TeY2d+Jbse/AFhKtHLqtrDPv4hC6Xl3f9fM3gEWEt3p+bVqxtkFHGtmc8NxLqylrnuAv5vZ54GXwv4VPhlqEEkq3UVbJEZm1sndd5pZD6Kzo7EhoNoTBcPY8F5SXY610907HaG6ZgOT3X3LkTieSHV0JiQSr3+aWVegDXBjxcKF7r7HzKYCfYkWM2s04ZLhrxVA0hh0JiQiIrHRxAQREYmNQkhERGKjEBIRkdgohEREJDYKIRERiY1CSEREYvP/AWhmCvvaZPIaAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f13bb5d1160>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "alpha is: 1.0\n"
     ]
    }
   ],
   "source": [
    "mse_mean=np.mean(ridge.cv_values_,axis=0)\n",
    "plt.plot(np.log(alphas),mse_mean.reshape(len(alphas),1))\n",
    "\n",
    "plt.xlabel('log(alpha)')\n",
    "plt.ylabel('mse')\n",
    "plt.show()\n",
    "\n",
    "print('alpha is:',ridge.alpha_)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "最佳正则项系数为1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "正则化的线性回归（L1正则 --> Lasso）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The r2 score of LassoCV on test is -0.8029352673100947\n",
      "The r2 score of LassoCV on train is 0.6801887745230781\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import LassoCV\n",
    "lasso=LassoCV()\n",
    "lasso.fit(x_train_1,y_train)\n",
    "\n",
    "y_test_pred_lasso=lasso.predict(x_test_1)\n",
    "y_train_pred_lasso=lasso.predict(x_train_1)\n",
    "\n",
    "print('The r2 score of LassoCV on test is',r2_score(y_test,y_test_pred_lasso))\n",
    "print('The r2 score of LassoCV on train is',r2_score(y_train,y_train_pred_lasso))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "训练集的r2 score约为0.68，说明训练集有百分之六十八符合,但较之岭回归减少了千分之四左右 \n",
    "测试集的r2 score约为-0.8，根据r2 score计算公式可知预测值减去真值大于真值本身之间的差异，r2 score为负值也可能说明特征可能取的有问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaEAAAEKCAYAAAC7c+rvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3XuYXVWZ5/HvW/cklaRyqZCQCwkQrgECFCHKTUEgoG3Q8QLaEhUnDQ3P4LQ9I2rP0I3282jbrTO2LYrCQ7AVcAAlYiJGRBAFQiXkSoAUIZdKKkmlrqlLquqceuePvQoORV1OKnVq16n6fR7Pc/Z599prr80xebPXWmcvc3dERETikBN3A0REZPRSEhIRkdgoCYmISGyUhEREJDZKQiIiEhslIRERiY2SkIiIxEZJSEREYqMkJCIiscmLuwHD3dSpU33u3LlxN0NEJKusW7fukLuX9ldOSagfc+fOpby8PO5miIhkFTPblU45dceJiEhslIRERCQ2SkIiIhIbJSEREYmNkpCIiMRGSUhERGKjJCQiIrHR74RERITOTqe2pZ199a3sqW1ld20LsyeP4UNnH5/R8yoJiYiMEIea2vj6E6+QSDp5uUZeTg45Fu0zg0TS6eh0OhKdNLcnaG5L0NyWpKa5ndrmNjr9nfV9+JzjlYR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sXajnk/206wfAo2b2ceDpcHyX94c2iGSUnqItEiMzKw4rUU4huju6KCSoMUSJ4aIwlpROXU3uXjxI7XoWWOrudYNRn0hvdCckEq8nzKwEKAC+7u77Ady91czuBGYSrTk1ZEKX4XeUgGQo6E5IRERio4kJIiISGyUhERGJjZKQiIjERklIRERioyQkIiKxURISEZHY/H/NuaA5DBZYSAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f13bb584be0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "alpha is: 11.800337760115797\n"
     ]
    }
   ],
   "source": [
    "mses=np.mean(lasso.mse_path_,axis=1)\n",
    "plt.plot(np.log10(lasso.alphas_),mses)\n",
    "plt.xlabel('log(alpha)')\n",
    "plt.ylabel('mse')\n",
    "plt.show()\n",
    "\n",
    "print('alpha is:',lasso.alpha_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "说明正则参数的最佳取值是11.80"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
